import { getChannelsApi } from "@/apis/article";
export interface Channel {
  id: number;
  name: string;
}
export const useChannel = () => {
  const [channelList, setChannelList] = useState<Channel[]>([
    { id: 0, name: "推荐"}
  ])
  useEffect(() => {
    getChannelsApi().then(res => {
      setChannelList(res.data.channels as Channel[])
    });
  }, []);
  return channelList

}